<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>小王工资</title>
</head>
<body>
<!-- 3、小王入职薪水10k,每年涨幅5%，10年后小王的月薪为多少，总收入为多少？ -->
<script>
        var salary = 10000; 
        //月薪
        var total = salary * 12;
         //年薪
        var year = 2;
        while (year <= 10) {
            salary = salary * 1.05;
            total += salary * 12;
            year++;
        }
        // 第二年的月薪
        // salary = salary * 1.05;
        // total += salary * 12;
        // 第三年
        // salary = salary * 1.05;
        // total += salary * 12;
     console.log(salary.toFixed(3), total.toFixed(3));

</script>
    
</body>
</html>